package server.model;

import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;


import server.model.administration.Admin;
import server.model.remotes.IAdmin;

public class Main {
	
	Registry registry;	
	IAdmin admin;
	
	public Main() {			
		createAdmin();
	}
	
	public static void main (String args[]){
		new Main();		
	}
	
	private void createAdmin(){
			
		try {
			admin = new Admin();
			registry = LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
			registry.rebind("virtualRoomReg", admin);			
			System.out.println("virtual room server started and listening....");			
			
		} catch (RemoteException e) {		
			e.printStackTrace();
		}	
	}
}